﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ZhouYu.NewWorld.Web.Models
{
    // 登录认证特性
    public class AuthenticationAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
           var admin = AdminUserContext.adminContext.Admin;
            if (admin == null)
            {
                filterContext.Result = new RedirectResult("/Home/Login");
            }
        }
    }
}

